import React from 'react';
import { ScrollView } from 'react-native';
import { Actions } from 'react-native-router-flux';
import Icon from 'react-native-vector-icons/Feather';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
import List from '../../../components/list';
import { addStars } from '../../../utils';

export default ({ user }) => {
  const DATA = [
    {
      onPress: Actions.personalBindMobile,
      title: '手机号',
      value: addStars(user.userInfo.mobile, 3, 6) || '未绑定',
      icon: <FontAwesome name="mobile" size={30} color="#0066cc" />
    },
    {
      onPress: user.wxAuth.bind(user, true),
      title: '微信号',
      value: user.userInfo.weChatOpenId ? '已绑定' : '未绑定',
      icon: <FontAwesome name="weixin" size={20} color="#093" />
    }
  ];
  return <List data={DATA} title="账户" />;
};
